<script lang="ts" setup>
import { defineProps } from "vue";
const {name, imgurl16v9, duration, playCount, id} = defineProps(["name", "imgurl16v9", "duration", "playCount", "id"])

</script>

<template>
  <div class="MVItemWrap">
    <div class="MVItem">
      <RouterLink :to="`/VideoDetail/${id}`">
        <img :src="imgurl16v9" alt="">
      </RouterLink>
      <div class="playcount">
        <span class="iconfont icon-24gl-play"></span>
        <span>{{ parseInt(playCount) >= 10000 ? Math.floor(parseInt(playCount) / 10000) + '万' :playCount }}</span>
      </div>
      <p class="time"><SongTime :songDuration=duration /></p>
    </div>
    <p class="desc">{{ name }}</p>
  </div>
</template>

<style lang="scss" scoped>
.MVItemWrap {
  width: 250px;
  margin: 0 12px 12px 0;

  .MVItem {
    position: relative;
    width: 100%;
    height: 135px;
    margin-bottom: 8px;

    img {
      width: 100%;
      height: 100%;
      border-radius: 8px;
    }

    .playcount {
      position: absolute;
      top: 0px;
      right: 8px;

      span {
        color: $theme-white;
        font-size: $font-size-xs;
      }
    }

    .time {
      position: absolute;
      bottom: 0px;
      right: 8px;
      color: $theme-white;
      font-size: $font-size-xs;
    }
  }

  .desc {
    font-size: $font-size-sm;
    font-family: $textFont;
  }
}


@media screen and (min-width: 1200px) {
  .MVItemWrap {
    width: 23% !important;
  }
}


@media screen and (min-width: 1320px) {
  .MVItemWrap {
    width: 19% !important;
  }
}
</style>
